const express = require('express')

const userInfoHandler = require('../router_handle/userinfo')
const router = express.Router()

const expressJoi = require('@escook/express-joi')
const update_user_schema = require('../schema/userinfo')
const update_avater_schema = require('../schema/userinfo')

router.get('/userinfo', userInfoHandler.getUserInfo)

//更新用户信息
router.post('/updateinfo', expressJoi(update_user_schema), userInfoHandler.updateUserInfo)

//更新头像信息
router.post('/update/avatar', expressJoi(update_avater_schema), userInfoHandler.updateUserAvater)

//更改密码
router.post('/updatepwd', expressJoi(update_user_schema), userInfoHandler.updateUserPwd)

module.exports = router